﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class cms_default : System.Web.UI.Page
{

    private debioscoopEntities db;

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Refresh(object sender, EventArgs e)
    {
        Response.Redirect(Request.RawUrl);
    }

    //protected void vestigingGridView_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    vestigingDetailsView.ChangeMode(DetailsViewMode.ReadOnly);
    //    string selected_id = vestigingDetailsView.DataKey[vestigingGridView.SelectedIndex]["bioscoop_id"].ToString();



    //    FilmDetailsOverview.ChangeMode(DetailsViewMode.ReadOnly);
    //    string select_id = FilmGridView.DataKeys[FilmGridView.SelectedIndex]["film_id"].ToString();
    //    Film_Select.SelectParameters.Clear();
    //    Film_Select.SelectParameters.Add("film_id", select_id);
    //    FilmDetailsOverview.DataBind();
    //}

    protected void studentGridView_SelectedIndexChanged(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(vestigingGridView.SelectedValue);

        BioscoopManager bioscoopManager = new BioscoopManager(db);
        List<bioscoop> test = bioscoopManager.getBioscoop(id);
        vestigingDetailsView.DataSource = test;
        vestigingDetailsView.DataBind();
        Response.Redirect(Request.RawUrl);
       
        //get details on id from database
        

      
    }

    protected void vestigingDetailsView_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        vestigingDetailsView.Visible = true;
        vestigingDetailsView.ChangeMode(DetailsViewMode.Insert);
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        vestigingDetailsView.ChangeMode(DetailsViewMode.ReadOnly);
        vestigingGridView.SelectedIndex = -1;
    }
    protected void vestigingGridView_SelectedIndexChanged(object sender, EventArgs e)
    {
        vestigingDetailsView.ChangeMode(DetailsViewMode.ReadOnly);
    }
}